﻿#ifndef IDAMAINWINDOW_H
#define IDAMAINWINDOW_H

#include <QMainWindow>
#include <QEventLoop>
#include <QPointer>
#include "API_BaseWidget.h"
#include "IdaPara.h"

namespace Ui { class IdaMainWindow; };

class IdaTitleBar;
class SAFramelessHelper;
class SARibbonMainWindowPrivate;
class API_BASEWIDGET IdaMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit IdaMainWindow(QWidget* parent = Q_NULLPTR, bool m_isDefaultUI = false);
    virtual ~IdaMainWindow();

    /// @brief 设置窗体按钮
    /// @param type 按钮类型
    void setWindowButtonType(BaseWidget::ETitleBars type);

    void setIsMainWindow(bool isMainWindow);

    void setTitleBarHeight(int height);

    void setTitleFontSize(int size);

    //返回SAFramelessHelper
    SAFramelessHelper* framelessHelper();

    void setInitializationWindowMaximization();

    void setIcon(const QIcon& icon);

signals:

    /// @brief 窗体状态变化
    /// @param windowState 窗体状态
    void signal_windowStateChange(Qt::WindowStates windowState);

    /// @brief 窗体关闭按钮被点击
    void signal_closeButtonClick();

private:

    /// @brief 初始化窗体
    void initWindow();

    /// @brief 移动到屏幕中心
    void moveToCenter();

private slots:

    /// @brief 初始化数据
    virtual void initData();
    void slot_updateWidgetCursor(Qt::CursorShape shap);
    void slot_resetWidgetCursor();

private:
    Ui::IdaMainWindow* ui;
    bool m_isDefaultUI;
    QPointer<IdaTitleBar> m_titlebar;	//标题栏
    SARibbonMainWindowPrivate* m_d;

};
#endif // IDAMAINWINDOW_H
